package com.yyx.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RefreshScope
@RestController
public class ClientController {

    @PostConstruct
    public void init() {
        System.out.println("config client started...");
    }

    @Value("${message: 本地消息}")
    private String message;

    @Value("${news: 消息}")
    private String news;

    @RequestMapping("/message")
    public String message() {
        return message;
    }

    @RequestMapping("/news")
    public String news() {
        return news;
    }


}
